<?php
$pdf = Yii::createComponent('application.extensions.MPDF56.mpdf');
$dataProvider = $_SESSION['datos_filtrados']->getData();
$contador=count($dataProvider);
    $html.=' <link rel="stylesheet" type="text/css" href="'.Yii::app()->request->baseUrl.'/css/pdf.css" />

    <table align="center"><tr>
    <td align="center"><b>Listado de Usuarios</b></td>
    </tr></table>
    Total Resultados: '.$contador.'
        <table class="detail-view2" repeat_header="1" cellpadding="1" cellspacing="1" width="100%" border="0">
            <tr class="principal">
                <td class="principal" width="7%">&nbsp;N° Usuario</td>
                <td class="principal" width="7%">&nbsp;Nombre de Usuario</td>
                <td class="principal" width="19%">&nbsp;Nombre</td>
                <td class="principal" width="10%">&nbsp;Apellido</td>
                <td class="principal" width="9%">&nbsp;Teléfono</td>
                <td class="principal" width="25%">&nbsp;Email</td>
                <td class="principal" width="14%">&nbsp;Direccion</td>
                <td class="principal" width="9%">&nbsp;Rol</td>
                <td class="principal" width="9%">&nbsp;Descuento</td>
            </tr>';
         $i=0;
         $val=count($dataProvider);
         
         while($i<$val){
$html.='
            <tr class="odd">
                <td class="odd" width="7%">&nbsp;'.$dataProvider[$i]["IDUSUARIO"].'</td>
                <td class="odd" width="7%">&nbsp;'.$dataProvider[$i]["Nick"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["NOMBRE"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["APELLIDO"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["TELEFONO"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["EMAIL"].'</td>
                <td class="odd" width="19%">&nbsp;'.$dataProvider[$i]["DIRECCION"].'</td>
                <td class="odd" width="10%">&nbsp;'.$dataProvider[$i]["rol"]["Rol"].'</td>
                <td class="odd" width="9%">&nbsp;'.$dataProvider[$i]["Descuentos"].'</td>
            ';
    $html.='</tr>'; $i++;
                        }
    $html.='</table>';


$header='<img src="'.'images/logo.png"/>';

$mpdf=new mPDF('win-1252','LETTER','','',10,10,25,12,5,7);
$mpdf->SetHTMLHeader($header);
$mpdf->SetFooter(' {DATE j/m/Y}|Página {PAGENO}/{nbpg}|Factura Proforma '.$model->IDFACTURA);
$mpdf->WriteHTML($html);
$mpdf->Output('Lista de Usuarios.pdf','D');
exit;
?>